package keeto.com.vn.bms.ui.fragment;

import keeto.com.vn.bms.ui.activity.R;
import keeto.com.vn.bms.ui.adapter.CalendarAdapter;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import android.widget.AdapterView.OnItemClickListener;

public class CalendarFragment extends Fragment {

	private GridView mGridView;
	private CalendarAdapter mAdapter;
	private OnItemClickListener onItemClickListener;

	
	public GridView getGridView() {
		return mGridView;
	}

	public CalendarAdapter getAdapter() {
		return mAdapter;
	}


	public void setAdapter(CalendarAdapter Adapter) {
		this.mAdapter = Adapter;
	}


	public OnItemClickListener getOnItemClickListener() {
		return onItemClickListener;
	}

	public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
		this.onItemClickListener = onItemClickListener;
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

	}

	
	@Override
	public View onCreateView(LayoutInflater inflater,
			@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		View v = inflater.inflate(R.layout.calendar_grid, container, false);
		mGridView = (GridView) v.findViewById(R.id.grid_calendar);
		if(mAdapter != null){
			mGridView.setAdapter(mAdapter);
		}
		if (onItemClickListener != null) {
			mGridView.setOnItemClickListener(onItemClickListener);
		}
		return v;
	}


}
